package com.test.service.uc;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.test.entity.uc.Person;
import com.test.mapper.uc.PersonMapper;

@Service("personService")
public class PersonService {
	
	@Resource(name="personMapper")
	private PersonMapper personMapper;
	
	/**
	 * 判断是否有人？
	 * @return
	 */
	@Transactional
	public boolean hasPerson(){
		List<Person> list = personMapper.getAllPerson();
		if(list.size() <= 0){
			return false;
		}else{
			return true;
		}
	}
	
	public void addPerson(Person person){
		int a = personMapper.addPerson(person);
		System.out.println("sd");
	}
}
